package com.ww.cheappliers.main;

import org.apache.log4j.Logger;

import com.ww.cheappliers.consumer.impl.LogConsumerImpl;
import com.ww.cheappliers.receive.MessageReaper;
import com.ww.cheappliers.receive.impl.EmailReaperImpl;

/**
 * 入口
 * @author tengHy
 *
 */
public class Main {
	final MessageReaper reaper;
	
	public Main(MessageReaper reaper){
		this.reaper = reaper;
	}
	
	public void start(){
		Logger.getLogger(this.getClass()).info("Running...");
		reaper.start();
	}
	
	public static void main(String[] args) {
		// maven命令 exec:java -Dexec.mainClass=com.ww.cheappliers.main.Main
		//System.err.println("test test");
		EmailReaperImpl e = new EmailReaperImpl();
		e.addConsumer(new LogConsumerImpl());
		e.sleepMills = 1 * 60 * 1000;
		Main m = new Main(e);
		m.start();
	}
}
